#include<bits/stdc++.h>
using namespace std;
int check(int a,int b)
{
	int r=0;
	while (a>0)
	{
		r=a%10;
		if (r==b) return 1;
		a=a/10;
	}
	return 0;
}
int main()
{
	int n,d;
	cin>>n>>d;
	if (check(n,d)) cout<<"true"<<endl;
	else cout<<"false"<<endl;
	return 0;
}